<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/base/connectionManager/BaseConnectionManager.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00245.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">BaseConnectionManager.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef BASECONNECTIONMANAGER_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define BASECONNECTIONMANAGER_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;MiXiMDefs.h&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;NicEntry.h&quot;</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="keyword">class </span><a class="code" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a>;
<a name="l00012"></a>00012 
<a name="l00029"></a><a class="code" href="a00019.html">00029</a> <span class="keyword">class </span>MIXIM_API <a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a> : <span class="keyword">public</span> cSimpleModule
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031 <span class="keyword">private</span>:
<a name="l00039"></a><a class="code" href="a00097.html">00039</a>   <span class="keyword">class </span><a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>
<a name="l00040"></a>00040   {
<a name="l00041"></a>00041   <span class="keyword">public</span>:
<a name="l00044"></a>00044     <span class="keywordtype">int</span> x;
<a name="l00045"></a>00045     <span class="keywordtype">int</span> y;
<a name="l00046"></a>00046     <span class="keywordtype">int</span> z;
<a name="l00049"></a>00049   <span class="keyword">public</span>:
<a name="l00054"></a><a class="code" href="a00097.html#acc40471233f51e22e561d78ef9231926">00054</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>()
<a name="l00055"></a>00055       :x(0), y(0), z(0) {};
<a name="l00056"></a>00056 
<a name="l00060"></a><a class="code" href="a00097.html#afa7e86ef98fd7a4d91d0fdfcdb17e9e3">00060</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y)
<a name="l00061"></a>00061       :x(x), y(y), z(0) {};
<a name="l00062"></a>00062 
<a name="l00066"></a><a class="code" href="a00097.html#acae21cc9126603082dbce10f45e97a5e">00066</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z)
<a name="l00067"></a>00067       :x(x), y(y), z(z) {};
<a name="l00068"></a>00068 
<a name="l00072"></a><a class="code" href="a00097.html#a4f3fd84363c60c0260dc01660b8a6dc8">00072</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>(<span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; o)
<a name="l00073"></a>00073       :x(o.x), y(o.y), z(o.z) {};
<a name="l00074"></a>00074 
<a name="l00080"></a><a class="code" href="a00097.html#a5277a00268c4b72ea0af57f595100f32">00080</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>(<span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>&amp; c, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>&amp; gridCellSize = <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>(1.0,1.0,1.0))
<a name="l00081"></a>00081       : x( static_cast&lt;int&gt;(c.x / gridCellSize.x) )
<a name="l00082"></a>00082       , y( static_cast&lt;int&gt;(c.y / gridCellSize.y) )
<a name="l00083"></a>00083       , z( static_cast&lt;int&gt;(c.z / gridCellSize.z) )
<a name="l00084"></a>00084     {}
<a name="l00085"></a>00085 
<a name="l00087"></a><a class="code" href="a00097.html#a91ebc91e4af84ce4cf11d177d8ed7813">00087</a>     std::string <a class="code" href="a00097.html#a91ebc91e4af84ce4cf11d177d8ed7813" title="Output string for this coordinate.">info</a>()<span class="keyword"> const </span>{
<a name="l00088"></a>00088       std::stringstream os;
<a name="l00089"></a>00089       os &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; x &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; y &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; z &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;
<a name="l00090"></a>00090       <span class="keywordflow">return</span> os.str();
<a name="l00091"></a>00091     }
<a name="l00092"></a>00092 
<a name="l00094"></a><a class="code" href="a00097.html#a2b7b149e4419a68dad34a9558f5c3c31">00094</a>     <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code" href="a00097.html#a2b7b149e4419a68dad34a9558f5c3c31" title="Comparison operator for coordinates.">operator==</a>(<span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; a, <span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; b) {
<a name="l00095"></a>00095       <span class="keywordflow">return</span> a.x == b.x &amp;&amp; a.y == b.y &amp;&amp; a.z == b.z;
<a name="l00096"></a>00096     }
<a name="l00097"></a>00097 
<a name="l00099"></a><a class="code" href="a00097.html#a8b6fb213ce1ee286ec6c894b7b22cfa5">00099</a>     <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code" href="a00097.html#a8b6fb213ce1ee286ec6c894b7b22cfa5" title="Comparison operator for coordinates.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; a, <span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; b) {
<a name="l00100"></a>00100       <span class="keywordflow">return</span> !(a==b);
<a name="l00101"></a>00101     }
<a name="l00102"></a>00102   };
<a name="l00103"></a>00103 
<a name="l00109"></a><a class="code" href="a00066.html">00109</a>   <span class="keyword">class </span><a class="code" href="a00066.html" title="Represents an minimalistic (hash)set of GridCoords.">CoordSet</a> {
<a name="l00110"></a>00110   <span class="keyword">protected</span>:
<a name="l00112"></a><a class="code" href="a00066.html#a6bf527335c1f943a562a948d63e1c435">00112</a>     std::vector&lt;GridCoord*&gt; <a class="code" href="a00066.html#a6bf527335c1f943a562a948d63e1c435" title="Holds the hash table.">data</a>;
<a name="l00114"></a><a class="code" href="a00066.html#ab92f6508285f667d0e7f811c74c048cc">00114</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00066.html#ab92f6508285f667d0e7f811c74c048cc" title="maximum size of the hash table.">maxSize</a>;
<a name="l00116"></a><a class="code" href="a00066.html#a81adb787e364efa97276766eb19fe644">00116</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00066.html#a81adb787e364efa97276766eb19fe644" title="Current number of entries in the hash table.">size</a>;
<a name="l00118"></a><a class="code" href="a00066.html#a0bdf347931c8b2c7ae970769291a804e">00118</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00066.html#a0bdf347931c8b2c7ae970769291a804e" title="Holds the current element when iterating over this table.">current</a>;
<a name="l00119"></a>00119 
<a name="l00120"></a>00120   <span class="keyword">protected</span>:
<a name="l00121"></a>00121 
<a name="l00130"></a><a class="code" href="a00066.html#a6f6a48e14b2c80e70d66f8fd3310df65">00130</a>     <span class="keywordtype">void</span> <a class="code" href="a00066.html#a6f6a48e14b2c80e70d66f8fd3310df65" title="Tries to insert a GridCoord at the specified position.">insert</a>(<span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; c, <span class="keywordtype">unsigned</span> pos) {
<a name="l00131"></a>00131       <span class="keywordflow">if</span>(data[pos] == 0) {
<a name="l00132"></a>00132         data[pos] = <span class="keyword">new</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>(c);
<a name="l00133"></a>00133         size++;
<a name="l00134"></a>00134       } <span class="keywordflow">else</span> {
<a name="l00135"></a>00135         <span class="keywordflow">if</span>(*data[pos] != c) {
<a name="l00136"></a>00136           insert(c, (pos + 2) % maxSize);
<a name="l00137"></a>00137         }
<a name="l00138"></a>00138       }
<a name="l00139"></a>00139     }
<a name="l00140"></a>00140 
<a name="l00141"></a>00141   <span class="keyword">public</span>:
<a name="l00145"></a><a class="code" href="a00066.html#a5c4c714b303d8a6ccae2628c22357556">00145</a>     <a class="code" href="a00066.html" title="Represents an minimalistic (hash)set of GridCoords.">CoordSet</a>(<span class="keywordtype">unsigned</span> sz)
<a name="l00146"></a>00146       :data(), maxSize(sz), size(0), current(0)
<a name="l00147"></a>00147     {
<a name="l00148"></a>00148       data.resize(maxSize);
<a name="l00149"></a>00149     }
<a name="l00150"></a>00150 
<a name="l00154"></a><a class="code" href="a00066.html#a3f1d637881b9e4ca2a306295eacdc634">00154</a>     <a class="code" href="a00066.html#a3f1d637881b9e4ca2a306295eacdc634" title="Delete every created GridCoord.">~CoordSet</a>() {
<a name="l00155"></a>00155       <span class="keywordflow">for</span>(std::vector&lt;GridCoord*&gt;::const_iterator it = data.begin(); it != data.end(); ++it) {
<a name="l00156"></a>00156         <span class="keywordflow">if</span>(*it) {
<a name="l00157"></a>00157           <span class="keyword">delete</span> *it;
<a name="l00158"></a>00158         }
<a name="l00159"></a>00159       }
<a name="l00160"></a>00160     }
<a name="l00161"></a>00161 
<a name="l00167"></a><a class="code" href="a00066.html#aaa3c6a4f31789b4644a5bb7aaf414206">00167</a>     <span class="keywordtype">void</span> <a class="code" href="a00066.html#aaa3c6a4f31789b4644a5bb7aaf414206" title="Adds a GridCoord to the set. If a GridCoord with the same value already exists in the set nothing hap...">add</a>(<span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; c) {
<a name="l00168"></a>00168       <span class="keywordtype">unsigned</span> hash = (c.x * 10000 + c.y * 100 + c.z) % maxSize;
<a name="l00169"></a>00169       insert(c, hash);
<a name="l00170"></a>00170     }
<a name="l00171"></a>00171 
<a name="l00176"></a><a class="code" href="a00066.html#a02d6a8788ed22b635e7d8edbcb576d9d">00176</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>* <a class="code" href="a00066.html#a02d6a8788ed22b635e7d8edbcb576d9d" title="Returns the next GridCoord in the set. You can iterate through the set only one time with this functi...">next</a>() {
<a name="l00177"></a>00177       <span class="keywordflow">for</span>(;current &lt; maxSize; current++) {
<a name="l00178"></a>00178         <span class="keywordflow">if</span>(data[current] != 0) {
<a name="l00179"></a>00179           <span class="keywordflow">return</span> data[current++];
<a name="l00180"></a>00180         }
<a name="l00181"></a>00181       }
<a name="l00182"></a>00182       <span class="keywordflow">return</span> 0;
<a name="l00183"></a>00183     }
<a name="l00184"></a>00184 
<a name="l00188"></a><a class="code" href="a00066.html#adc447bc3bef91b0edd4349b803a48da1">00188</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00066.html#adc447bc3bef91b0edd4349b803a48da1" title="Returns the number of GridCoords currently saved in this set.">getSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> size; }
<a name="l00189"></a>00189 
<a name="l00195"></a><a class="code" href="a00066.html#ad4c6538276bc45a1efdeb8ebbfaf3d9f">00195</a>     <span class="keywordtype">unsigned</span> <a class="code" href="a00066.html#ad4c6538276bc45a1efdeb8ebbfaf3d9f" title="Returns the maximum number of elements which can be stored inside this set. To prevent collisions the...">getmaxSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> maxSize; }
<a name="l00196"></a>00196   };
<a name="l00197"></a>00197 
<a name="l00198"></a>00198 <span class="keyword">protected</span>:
<a name="l00200"></a><a class="code" href="a00019.html#a8438ef8cd5adf3c9f3804f088813679e">00200</a>   <span class="keyword">typedef</span> std::map&lt;NicEntry::t_nicid, NicEntry*&gt; <a class="code" href="a00019.html#a8438ef8cd5adf3c9f3804f088813679e" title="Type for map from nic-module id to nic-module pointer.">NicEntries</a>;
<a name="l00201"></a>00201 
<a name="l00203"></a><a class="code" href="a00019.html#a9e2d47a851899da506730fcdda24030e">00203</a>   <a class="code" href="a00019.html#a8438ef8cd5adf3c9f3804f088813679e" title="Type for map from nic-module id to nic-module pointer.">NicEntries</a> <a class="code" href="a00019.html#a9e2d47a851899da506730fcdda24030e" title="Map from nic-module ids to nic-module pointers.">nics</a>;
<a name="l00204"></a>00204 
<a name="l00206"></a><a class="code" href="a00019.html#a6b75c5b6311b76e4894d669524a15043">00206</a>   <span class="keywordtype">bool</span> <a class="code" href="a00019.html#a6b75c5b6311b76e4894d669524a15043" title="Set debugging for the basic module.">coreDebug</a>;
<a name="l00207"></a>00207 
<a name="l00209"></a><a class="code" href="a00019.html#acdfe4a6c7e4d6cfc729219946488a1be">00209</a>   <span class="keywordtype">bool</span> <a class="code" href="a00019.html#acdfe4a6c7e4d6cfc729219946488a1be" title="Does the ConnectionManager use sendDirect or not?">sendDirect</a>;
<a name="l00210"></a>00210 
<a name="l00212"></a><a class="code" href="a00019.html#ab68d40f806cce405a8e97958f1245303">00212</a>   <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>* <a class="code" href="a00019.html#ab68d40f806cce405a8e97958f1245303" title="Stores the size of the playground.">playgroundSize</a>;
<a name="l00213"></a>00213 
<a name="l00215"></a><a class="code" href="a00019.html#a1570049e688ff532c2454fce2ef02f3f">00215</a>   <span class="keywordtype">double</span> <a class="code" href="a00019.html#a1570049e688ff532c2454fce2ef02f3f" title="the biggest interference distance in the network.">maxInterferenceDistance</a>;
<a name="l00216"></a>00216 
<a name="l00219"></a><a class="code" href="a00019.html#aa9b0c739744c1eafd365add0afe4a037">00219</a>   <span class="keywordtype">double</span> <a class="code" href="a00019.html#aa9b0c739744c1eafd365add0afe4a037" title="Square of maxInterferenceDistance cache a value that is often used.">maxDistSquared</a>;
<a name="l00220"></a>00220 
<a name="l00222"></a><a class="code" href="a00019.html#ade8a5353ad5be39ebb3830e45ec64fbc">00222</a>   <span class="keywordtype">bool</span> <a class="code" href="a00019.html#ade8a5353ad5be39ebb3830e45ec64fbc" title="Stores the useTorus flag of the WorldUtility.">useTorus</a>;
<a name="l00223"></a>00223 
<a name="l00226"></a><a class="code" href="a00019.html#acc2243ef90f9857769043cd040c48705">00226</a>   <span class="keywordtype">bool</span> <a class="code" href="a00019.html#acc2243ef90f9857769043cd040c48705" title="Stores if maximum interference distance should be displayed in TkEnv.">drawMIR</a>;
<a name="l00227"></a>00227 
<a name="l00229"></a><a class="code" href="a00019.html#a07e3ba99630593a0b453056767f3c419">00229</a>   <span class="keyword">typedef</span> std::vector&lt;NicEntries&gt; <a class="code" href="a00019.html#a07e3ba99630593a0b453056767f3c419" title="Type for 1-dimensional array of NicEntries.">RowVector</a>;
<a name="l00231"></a><a class="code" href="a00019.html#a332ff3a0e07c412efaaa2332b00b1c38">00231</a>   <span class="keyword">typedef</span> std::vector&lt;RowVector&gt; <a class="code" href="a00019.html#a332ff3a0e07c412efaaa2332b00b1c38" title="Type for 2-dimensional array of NicEntries.">NicMatrix</a>;
<a name="l00233"></a><a class="code" href="a00019.html#a6b43342fe2608cb862e03c07cf9f799b">00233</a>     <span class="keyword">typedef</span> std::vector&lt;NicMatrix&gt; <a class="code" href="a00019.html#a6b43342fe2608cb862e03c07cf9f799b" title="Type for 3-dimensional array of NicEntries.">NicCube</a>;
<a name="l00234"></a>00234 
<a name="l00241"></a><a class="code" href="a00019.html#a4d9992e134da9af1d9b90deba1d7759a">00241</a>     <a class="code" href="a00019.html#a6b43342fe2608cb862e03c07cf9f799b" title="Type for 3-dimensional array of NicEntries.">NicCube</a> <a class="code" href="a00019.html#a4d9992e134da9af1d9b90deba1d7759a" title="Register of all nics.">nicGrid</a>;
<a name="l00242"></a>00242 
<a name="l00251"></a><a class="code" href="a00019.html#a9a4bce8e878f2d6aa18fb2606f6d8409">00251</a>     <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a> <a class="code" href="a00019.html#a9a4bce8e878f2d6aa18fb2606f6d8409" title="Distance that helps to find a node under a certain position.">findDistance</a>;
<a name="l00252"></a>00252 
<a name="l00254"></a><a class="code" href="a00019.html#afea80604515a28ff8a6a1d07b9b0a9d3">00254</a>     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> <a class="code" href="a00019.html#afea80604515a28ff8a6a1d07b9b0a9d3" title="The size of the grid.">gridDim</a>;
<a name="l00255"></a>00255 
<a name="l00256"></a>00256 <span class="keyword">private</span>:
<a name="l00258"></a>00258     <span class="keywordtype">void</span> updateNicConnections(<a class="code" href="a00019.html#a8438ef8cd5adf3c9f3804f088813679e" title="Type for map from nic-module id to nic-module pointer.">NicEntries</a>&amp; nmap, NicEntries::mapped_type nic);
<a name="l00259"></a>00259 
<a name="l00263"></a>00263     <span class="keywordtype">void</span> checkGrid(<a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp;           oldCell,
<a name="l00264"></a>00264                    <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp;           newCell,
<a name="l00265"></a>00265                    NicEntry::t_nicid_cref <span class="keywordtype">id</span>);
<a name="l00266"></a>00266 
<a name="l00270"></a>00270     <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> getCellForCoordinate(<span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>&amp; c) <span class="keyword">const</span>;
<a name="l00271"></a>00271 
<a name="l00276"></a>00276     <a class="code" href="a00019.html#a8438ef8cd5adf3c9f3804f088813679e" title="Type for map from nic-module id to nic-module pointer.">NicEntries</a>&amp; getCellEntries(<span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; cell);
<a name="l00277"></a>00277 
<a name="l00283"></a>00283     <span class="keywordtype">int</span> wrapIfTorus(<span class="keywordtype">int</span> value, <span class="keywordtype">int</span> max) <span class="keyword">const</span>;
<a name="l00284"></a>00284 
<a name="l00288"></a>00288     <span class="keywordtype">void</span> fillUnionWithNeighbors(<a class="code" href="a00066.html" title="Represents an minimalistic (hash)set of GridCoords.">CoordSet</a>&amp; gridUnion, <span class="keyword">const</span> <a class="code" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>&amp; cell) <span class="keyword">const</span>;
<a name="l00289"></a>00289 <span class="keyword">protected</span>:
<a name="l00290"></a>00290 
<a name="l00301"></a>00301   <span class="keyword">virtual</span> <span class="keywordtype">double</span> calcInterfDist() = 0;
<a name="l00302"></a>00302 
<a name="l00315"></a>00315   <span class="keyword">virtual</span> <span class="keywordtype">void</span> registerNicExt(NicEntry::t_nicid_cref nicID);
<a name="l00316"></a>00316 
<a name="l00329"></a>00329   <span class="keyword">virtual</span> <span class="keywordtype">void</span> unregisterNicExt(NicEntry::t_nicid_cref nicID);
<a name="l00330"></a>00330 
<a name="l00343"></a>00343   <span class="keyword">virtual</span> <span class="keywordtype">void</span> updateConnections(NicEntry::t_nicid_cref nicID, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>* oldPos, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>* newPos);
<a name="l00354"></a>00354   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> isInRange(NicEntries::mapped_type pFromNic, NicEntries::mapped_type pToNic);
<a name="l00355"></a>00355 
<a name="l00356"></a>00356 <span class="keyword">private</span>:
<a name="l00359"></a>00359   <a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a>(<span class="keyword">const</span> <a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a>&amp;);
<a name="l00362"></a>00362   <a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a>&amp;);
<a name="l00363"></a>00363 
<a name="l00364"></a>00364 <span class="keyword">public</span>:
<a name="l00365"></a>00365   <a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a>();
<a name="l00366"></a>00366   <span class="keyword">virtual</span> ~<a class="code" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a>();
<a name="l00367"></a>00367 
<a name="l00369"></a><a class="code" href="a00019.html#a046d0df64848f1932ac1580be9d5306f">00369</a>   <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a00019.html#a046d0df64848f1932ac1580be9d5306f" title="Needs two initialization stages.">numInitStages</a>()<span class="keyword"> const </span>{
<a name="l00370"></a>00370     <span class="keywordflow">return</span> 2;
<a name="l00371"></a>00371   }
<a name="l00372"></a>00372 
<a name="l00377"></a>00377   <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keywordtype">int</span> stage);
<a name="l00378"></a>00378 
<a name="l00385"></a>00385         <span class="keywordtype">bool</span> registerNic(cModule* nic, <a class="code" href="a00053.html" title="Basic class for all physical layers, please don&#39;t touch!!">ConnectionManagerAccess</a>* chAccess, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>* nicPos);
<a name="l00386"></a>00386 
<a name="l00399"></a>00399   <span class="keywordtype">bool</span> unregisterNic(cModule* nic);
<a name="l00400"></a>00400 
<a name="l00402"></a>00402   <span class="keywordtype">void</span> updateNicPos(NicEntry::t_nicid_cref nicID, <span class="keyword">const</span> <a class="code" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a>* newPos);
<a name="l00403"></a>00403 
<a name="l00405"></a>00405   <span class="keyword">const</span> <a class="code" href="a00159.html#a209882de7781ff52db0ae559c1654e08" title="Type for map from NicEntry pointer to a gate.">NicEntry::GateList</a>&amp; getGateList(NicEntry::t_nicid_cref nicID) <span class="keyword">const</span>;
<a name="l00406"></a>00406 
<a name="l00408"></a>00408   <span class="keyword">const</span> cGate* getOutGateTo(<span class="keyword">const</span> <a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>* nic, <span class="keyword">const</span> <a class="code" href="a00159.html" title="NicEntry is used by ConnectionManager to store the necessary information for each nic...">NicEntry</a>* targetNic) <span class="keyword">const</span>;
<a name="l00409"></a>00409 };
<a name="l00410"></a>00410 
<a name="l00411"></a>00411 <span class="preprocessor">#endif </span><span class="comment">/*BASECONNECTIONMANAGER_H_*/</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>BaseConnectionManager.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:29 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
